const expresss = require("express")
const expressjoi = require("@escook/express-joi")

const myrouter = expresss.Router()
const {
  reg_updata_scheam,
  update_password_schema,
  reg_avatar_scheam,
} = require("../scheam/my")

const myControl = require("../control/my")

myrouter.get("/userinfo", myControl.userinfo)

myrouter.post(
  "/userinfo",
  expressjoi(reg_updata_scheam),
  myControl.updatauserinfo
)

myrouter.post(
  "/updatepwd",
  expressjoi(update_password_schema),
  myControl.updatauserpassword
)

myrouter.post(
  "/update/avatar",
  expressjoi(reg_avatar_scheam),
  myControl.updataavatar
)

module.exports = myrouter
